// 统一管理 日常帖详情 请求方法

import {
  baseUrl
} from "@/config/baseUrl";
import {
  request
} from "@/utils/request";

const API = {
  SCANADDDAILY_URL: "/blog/click/0/", // 浏览量+1
  GETCOMMENTLIST_URL: "/blogService/comment/get/", // 获取评论列表
  LIKEBLOG_URL: "/blogService/like/blog/", // 点赞帖子
  LIKECOMMENT_URL: "/blogService/like/comment/" // 点赞评论
}

// 浏览量+1
export const reqScanAddDaily = (id) => request({
  url: API.SCANADDDAILY_URL + id,
  method: "GET",
})

// 获取评论列表
export const reqGetCommentList = (blogId, startId) => request({
  url: API.GETCOMMENTLIST_URL + `${blogId}/${startId}`,
  method: "GET"
})

// 点赞帖子
export const reqLikeBlog = (id) => request({
  url: API.LIKEBLOG_URL + id,
  method: 'PUT'
})

// 点赞评论
export const reqLikeComment = (id) => request({
  url: API.LIKECOMMENT_URL + id,
  method: 'PUT'
})